package zhishuang.wang.sansi.x9;

/**
 * @Author Zhishuang.Wang
 * @Date 2023/7/5 11:21
 * @Email 1406110602@qq.com
 */

import zhishuang.wang.sansi.playlist.AreaItem;
import zhishuang.wang.sansi.playlist.PageItem;
import zhishuang.wang.sansi.playlist.PlayItem;
import zhishuang.wang.sansi.playlist.PlayList;
import zhishuang.wang.sansi.playlist.PlayPlan;
import zhishuang.wang.sansi.playlist.entry.AreaPositon;
import zhishuang.wang.sansi.playlist.entry.Background;
import zhishuang.wang.sansi.playlist.entry.BaseColour;
import zhishuang.wang.sansi.playlist.entry.PlayTimeBase;
import zhishuang.wang.sansi.playlist.entry.TextBase;
import zhishuang.wang.sansi.playlist.entry.TimePlan;
import zhishuang.wang.sansi.playlist.x9.PlayListX9;
import zhishuang.wang.sansi.tools.ReturnData;
import java.util.ArrayList;
import java.util.List;

public class TestX9PlayList {
    public TestX9PlayList() {
    }

    public static void testX9PlayList() {
        TextBase textBase1 = new TextBase(0, "12131321312");
        PlayTimeBase playTime1 = new PlayTimeBase(10000);
        PlayItem pItem1 = new PlayItem(1, "ite1", "111", textBase1, playTime1);
        List<PlayItem> palyItemList = new ArrayList();
        palyItemList.add(pItem1);
        AreaPositon areaPositon1 = new AreaPositon(0, 0, 240, 240, 1);
        AreaItem ai1 = new AreaItem("areaitem1", "areaitem1", areaPositon1, palyItemList);
        Background background1 = new Background();
        background1.setTransparentFlag(0);
        BaseColour backColour1 = new BaseColour(127, 127, 127, 0, 0);
        background1.setBackColour(backColour1);
        ai1.setBackground(background1);
        List<AreaItem> areaItemList = new ArrayList();
        areaItemList.add(ai1);
        PageItem pi1 = new PageItem("pageitem1", "pageitem1", areaItemList);
        List<PageItem> pageItemList = new ArrayList();
        pageItemList.add(pi1);
        TimePlan tp1 = new TimePlan(1, 127, Integer.MAX_VALUE, "2021-03-02", "2021-07-30", "00:00:00", "24:00:00");
        PlayPlan pp1 = new PlayPlan("playplan1", "playplan1", tp1, pageItemList);
        List<PlayPlan> playPlanList = new ArrayList();
        playPlanList.add(pp1);
        PlayList playList = new PlayList("playlist", "playlist", playPlanList);
        PlayListX9 x9PlayList = new PlayListX9();
        ReturnData rd = x9PlayList.createXstudioPlayList("E:\\downtest\\bmp\\x9play.txt", playList);
        System.out.println("===" + rd.getCode());
        System.out.println("===" + rd.getMessage());
    }
}